import request from '@/utils/request'

// 查询参数列表
export function listRegion(query) {
  return request({
    url: '/foundation/region/list',
    method: 'get',
    params: query
  })
}

// 查询参数详细
export function getRegion(configId) {
  return request({
    url: '/foundation/region/' + configId,
    method: 'get'
  })
}

// 根据参数键名查询参数值
export function getRegionKey(configKey) {
  return request({
    url: '/foundation/region/configKey/' + configKey,
    method: 'get'
  })
}

// 新增参数配置
export function addRegion(data) {
  return request({
    url: '/foundation/region',
    method: 'post',
    data: data
  })
}

// 修改参数配置
export function updateRegion(data) {
  return request({
    url: '/foundation/region',
    method: 'put',
    data: data
  })
}

// 删除参数配置
export function delRegion(configId) {
  return request({
    url: '/foundation/region/' + configId,
    method: 'delete'
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/foundation/region/refreshCache',
    method: 'delete'
  })
}
